/*---------------------------------------------------------------------
 * File name: list.h
 *
 * Copyright (c) <2020-2022>, <ChenLong>
 *
 * All rights reserved.
 *
 * Author: ChenLong
 * Email: worldlong@foxmail.com
 *--------------------------------------------------------------------*/
#pragma once
/*
*/
class BListNode
{
public:
  BListNode(void *data0) : 
    data(data0),
    prev(this),
    next(this)
    {}
    
    void *data;
    BListNode *prev;
    BListNode *next;
};
/*
*/
class BList
{
public:
  BList() : 
    node(0),
    number(0)
    {}
    
  BListNode *node;
  int number;
  
  /*fb == 'f' insert front of node0,
    fb == 'b' insert back of node0 */ 
  void insert(BListNode *node0, BListNode *new_node, char fb);
  void insert(BListNode *new_node, char fb) {
    insert(node, new_node, fb);
  }
  void remove(BListNode *node0);
};


